//
//  GiftBomView.swift
//  WalkNovel
//
//  Created by Kevin on 2023/9/18.
//

import UIKit

class GiftBomView: UIView {
    
    lazy var rechargeImage: UIImageView = {
        return UIImageView(image: UIImage(named: "reward_coin"))
    }()
    
    lazy var moneyBtn: UIButton = {
        let btn = UIButton.init(type: .custom)
        btn.setTitleColor(.black, for: .normal)
        btn.titleLabel?.font = .wn_font(name: .bold, size: 16)
        return btn
    }()

    lazy var giveBtn: UIButton = {
        let btn = UIButton(type: .custom)
        btn.setTitleColor(.white, for: .normal)
        btn.titleLabel?.font = .wn_font(name: .bold, size: 14)
        btn.setTitle("贈與", for: .normal)
        btn.backgroundColor = WNColor.Fade().left2right(.init(width: 120, height: 36))
        btn.wn_cornerWithBorder(18)
        return btn
    }()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        addSubview(rechargeImage)
        addSubview(moneyBtn)
        addSubview(giveBtn)
        rechargeImage.snp.makeConstraints { (make) in
            make.centerY.equalToSuperview()
            make.left.equalTo(scaleWidth(24))
            make.width.height.equalTo(28)
        }
        moneyBtn.snp.makeConstraints { (make) in
            make.centerY.equalToSuperview()
            make.left.equalTo(rechargeImage.snp.right).offset(8)
        }
        giveBtn.snp.makeConstraints { (make) in
            make.centerY.equalToSuperview()
            make.right.equalTo(-12)
            make.size.equalTo(CGSize.init(width: 120, height: 36))
        }
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
